//Loading
$(document).on('pagebeforecreate', function(){  
    var interval = setInterval(function(){
        $.mobile.loading('show');
        clearInterval(interval);
    },1);     
});


//Menu functions
function openMenu(){
	$( "#menu-panel" ).panel("open");
}

function exitAPP(){
	if(confirm($("#confirm_msgTag").html())){
		navigator.app.exitApp();
	}
}

function backToHome(){
	window.location.href='index.html';	
}

function backToHomeDeep(){
	window.location.href='../index.html';	
}

//Database
var db;
var shortName = 'zoom_DB';
var version = '1.0';
var displayName = 'zoom_DB';
var maxSize = 65535;


//Cookies
function createCookie(name, value, days) {
    if (!days || days=="") {
        days=100;
    }

    $.cookie(name, value, { expires: days });
}

function readCookie(name) {
	if($.cookie(name)){
		return $.cookie(name);
	}
    return "";
}

function eraseCookie(name) {
	$.removeCookie(name);
}


